// pages/settings/settings.less

/* 1. 变量定义 */
@color-main-text: #303133;
@color-regular-text: #606266;
@color-secondary-text: #909399;
@color-placeholder-text: #c0c4cc;
@color-theme: #19be6b;
@color-danger: #f56c6c;
@color-warning: #f9ae3d;
@page-bg: #f5f5f5;

@font-size-lg: 28rpx;
@font-size-md: 26rpx;
@font-size-sm: 24rpx;
@font-size-xs: 22rpx;

/* 2. 页面整体布局 */
.page-container {
  background-color: @page-bg;
  min-height: 100vh;
  padding-bottom: 40rpx;
  box-sizing: border-box;
}

/* 3. 卡片组样式 */
.settings-group {
  margin: 24rpx;
  background-color: #fff;
  border-radius: 16rpx;
  overflow: hidden;

  .group-title {
    color: @color-regular-text;
    font-size: @font-size-md;
    padding: 24rpx 30rpx 8rpx;
    font-weight: bold;
  }
}

/* 4. 列表项单元格样式 */
.settings-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28rpx 30rpx;
  background-color: #fff;
  position: relative;

  &:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 30rpx;
    right: 0;
    height: 1px;
    background-color: #ebedf0;
    transform: scaleY(0.5);
  }

  &.cell-hover,
  &:active {
    background-color: #fafafa;
    transition: background-color 0.2s;
  }

  .cell-label {
    color: @color-main-text;
    font-size: @font-size-lg;
  }

  .cell-content {
    display: flex;
    align-items: center;
    color: @color-secondary-text;
    font-size: @font-size-md;

    .cell-text {
      margin-right: 16rpx;
    }

    .cell-text-placeholder {
      color: @color-placeholder-text;
    }

    .arrow {
      font-family: 'Courier New', Courier, monospace;
      font-weight: bold;
      font-size: 36rpx;
      color: @color-placeholder-text;
      transform: scaleY(1.2);
    }
  }
}

/* 5. 头像单元格特殊样式 */
.avatar-cell {
  padding: 16rpx 30rpx;

  .avatar-button {
    position: relative;
    padding: 0;
    margin: 0;
    background-color: transparent;
    border: none;
    line-height: 1;

    &::after {
      border: none;
    }

    // t-avatar的size="large"是96rpx
    width: 96rpx;
    height: 96rpx;
    margin-right: 16rpx;
  }
}

/* 6. 操作按钮区域 */
.action-group {
  margin: 40rpx 24rpx 0;

  .action-item {
    margin-bottom: 30rpx;

    .action-button {
      --button-default-background-color: #ffffff;
      --button-default-color: @color-main-text;
      font-size: @font-size-lg;
      font-weight: 500;
    }

    .action-desc {
      margin-top: 12rpx;
      text-align: center;
      font-size: @font-size-sm;
      color: @color-secondary-text;
    }
  }
}

/* 7. 弹窗内部样式 */
.popup-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #f8f8f8;

  .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24rpx 30rpx;
    background-color: #fff;
    border-bottom: 1px solid #ebedf0;

    .popup-title {
      font-size: @font-size-lg;
      color: @color-main-text;
      font-weight: bold;
    }

    .popup-close {
      font-size: 32rpx;
      color: @color-secondary-text;
      padding: 10rpx;
    }
  }

  .popup-content {
    flex: 1;
    padding: 40rpx 30rpx;

    .popup-input {
      width: 100%;
      height: 90rpx;
      padding: 0 24rpx;
      font-size: @font-size-lg;
      background-color: #fff;
      border-radius: 12rpx;
      border: 1px solid #e0e0e0;
      box-sizing: border-box;

      &:focus {
        border-color: @color-theme;
      }
    }

    .qrcode-editor {
      text-align: center;

      .qrcode-preview {
        width: 250rpx;
        height: 250rpx;
        margin-bottom: 30rpx;
        background-color: #fff;
        border: 1px dashed @color-placeholder-text;
        border-radius: 12rpx;
      }
    }
  }

  .popup-footer {
    padding: 20rpx 30rpx;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);

    .confirm-btn {
      --button-border-radius: 20rpx;
    }
  }
}